<?php
function getCategory()
{
    global $catid;
    $category = BL_getCategory($catid);
    $attributes = $category->getAttributes();
    $attrs = "";
    for ($i = 0; $i < count($attributes); $i++) {
        $string = $attributes[$i]->getName();
        if ($attributes[$i]->getType() == 'i') {
            $string = $string . "~measurable~" . $attributes[$i]->getBestValue();
            if ($attributes[$i]->getBestValue() == "close_to")
                $string = $string . "~" . $attributes[$i]->getCloseToValue();
        } else
            if ($attributes[$i]->getType() == 'f') {
                $string = $string . "~unmeasurable";
            }
        if ($attrs != "")
            $attrs = $attrs . "," . $string;
        else
            $attrs = $string;
    }
    return $attrs;
}

function getCategoryModerators()
{
    global $catid;
    $users = BL_getCategoryMods($catid);
    $usernames = "";
    for ($i = 0; $i < count($users); $i++) {
        $user = BL_getUserData($users[$i]);
        if ($usernames != "")
            $usernames = $usernames . "," . $user->GetUsername();
        else
            $usernames = $user->GetUsername();
    }
    return $usernames;
}

function getIrrelevantUsers(){
    global $catid;
    $users = BL_getUsersPruned($catid);
    $irrelevant = "";
    for ($i = 0; $i < count($users); $i++) {
        if ($irrelevant != "")
            $irrelevant = $irrelevant . "," . $users[$i]['username'];
        else
            $irrelevant = $users[$i]['username'];
    }
    return $irrelevant;
}

function getInvitedUsers(){
    global $catid;
    $users = BL_getCategoryUsers($catid);
    $invited = "";
    for ($i = 0; $i < count($users); $i++) {
        $user = BL_getUserData($users[$i]);
        if ($invited != "")
            $invited = $invited . "," . $user->GetUsername();
        else
            $invited = $user->GetUsername();
    }
    return $invited;
}

?>